using System.Drawing;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using AndyPike.Experiments.Fluent.Interfaces;

namespace AndyPike.Experiments.Fluent.Commands
{
    public enum ResizeMode { FixedWidth, FixedHeight, BestFit, CropFit }
    
    public class ResizeCommand : ICommand
    {
        private readonly int width;
        private readonly int height;
        private readonly ResizeMode mode;

        public ResizeCommand(int width, int height, ResizeMode mode)
        {
            this.width = width;
            this.height = height;
            this.mode = mode;
        }

        public WriteableBitmap Execute(WriteableBitmap image)
        {
            /*var transformed = new TransformedBitmap();

            transformed.BeginInit();
            transformed.Source = image;
            transformed.Transform = new ScaleTransform(width, height);
            transformed.EndInit();
            
            return new WriteableBitmap(transformed);*/
            var output = new Bitmap(width, height);
            Graphics g = Graphics.FromImage(output);
            g.DrawImage(input, ...);
            
            return new WriteableBitmap(output);
        }
    }
}